package com.qingcheng.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.qingcheng.pojo.seckill.SeckillGoods;
import com.qingcheng.service.seckill.SeckillGoodsService;
import com.qingcheng.util.DateUtil;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;
import java.util.List;

/**
 * @Author:boy
 * @Date:2019/7/23
 * @description:
 * @ModifiedBy:
 */
@RestController
@RequestMapping("/seckill/goods")
public class SeckillGoodsController {
    @Reference
    private SeckillGoodsService seckillGoodsService;
    @GetMapping("/menus")
    public List<Date> getDateMenus(){
        return DateUtil.getDateMenus();
    }
    @GetMapping("/list")
    public List<SeckillGoods> list(String time){
        return seckillGoodsService.list(time);
    }
    @RequestMapping("/one")
    public SeckillGoods one(String time,Long id){
      return seckillGoodsService.findOne(time,id);
    }
}
